Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Managing Shader Characteristics

QuickDraw 3D provides routines for getting and setting characteristics that define how a shader affects a surface.

Q3Shader_GetUVTransform

You can use the Q3Shader_GetUVTransform function to get the current transform in uv parametric space.

TQ3Status Q3Shader_GetUVTransform (
                     TQ3ShaderObject shader,
                     TQ3Matrix3x3 *uvTransform);
shader
A shader.
uvTransform
On exit, a pointer to the current transform in uv parametric space.

DESCRIPTION

The Q3Shader_GetUVTransform function returns, in the uvTransform parameter, the current transform in uv parametric space for the shader specified by the shader parameter.

Q3Shader_SetUVTransform

You can use the Q3Shader_SetUVTransform function to set the transform in uv parametric space.

TQ3Status Q3Shader_SetUVTransform (
                     TQ3ShaderObject shader,
                     const TQ3Matrix3x3 *uvTransform);
shader
A shader.
uvTransform
A pointer to the desired transform in uv parametric space.

DESCRIPTION

The Q3Shader_SetUVTransform function sets the transform in uv parametric space for the shader specified by the shader parameter to the transform specified by the uvTransform parameter. For example, a texture shader that relies on uv values to index a texture mapping can rotate, scale, or translate the texture by setting appropriate values in the uv transform.

Q3Shader_GetUBoundary

You can use the Q3Shader_GetUBoundary function to get the current boundary-handling method for u values that are outside the range 0 to 1.

TQ3Status Q3Shader_GetUBoundary (
                     TQ3ShaderObject shader,
                     TQ3ShaderUVBoundary *uBoundary);
shader
A shader.
uBoundary
On exit, a value that indicates the current method of handling u values that are outside the range 0 to 1. See "Boundary-Handling Methods" for a description of the values that can be returned.

DESCRIPTION

The Q3Shader_GetUBoundary function returns, in the uBoundary parameter, the current method used by the shader specified by the shader parameter of handling u values that are outside the range 0 to 1. If Q3Shader_GetUBoundary completes successfully, the uBoundary parameter contains one of these values:

typedef enum TQ3ShaderUVBoundary {
    kQ3ShaderUVBoundaryWrap,
    kQ3ShaderUVBoundaryClamp
} TQ3ShaderUVBoundary;

Q3Shader_SetUBoundary

You can use the Q3Shader_SetUBoundary function to set the current boundary-handling method for u values that are outside the range 0 to 1.

TQ3Status Q3Shader_SetUBoundary (
                     TQ3ShaderObject shader,
                     TQ3ShaderUVBoundary uBoundary);
shader
A shader.
uBoundary
A value that indicates the desired method of handling u values that are outside the range 0 to 1. See "Boundary-Handling Methods" for a description of the values that you can pass in this parameter.

DESCRIPTION

The Q3Shader_SetUBoundary function sets the boundary-handling method for u values to be used by the shader specified by the shader parameter to the method specified by the uBoundary parameter.

Q3Shader_GetVBoundary

You can use the Q3Shader_GetVBoundary function to get the current boundary-handling mode for v values that are outside the range 0 to 1.

TQ3Status Q3Shader_GetVBoundary (
                     TQ3ShaderObject shader,
                     TQ3ShaderUVBoundary *vBoundary);
shader
A shader.
vBoundary
On exit, a value that indicates the current method of handling v values that are outside the range 0 to 1. See "Boundary-Handling Methods" for a description of the values that can be returned.

DESCRIPTION

The Q3Shader_GetVBoundary function returns, in the vBoundary parameter, the current method used by the shader specified by the shader parameter of handling v values that are outside the range 0 to 1. If Q3Shader_GetVBoundary completes successfully, the vBoundary parameter contains one of these values:

typedef enum TQ3ShaderUVBoundary {
    kQ3ShaderUVBoundaryWrap,
    kQ3ShaderUVBoundaryClamp
} TQ3ShaderUVBoundary;

Q3Shader_SetVBoundary

You can use the Q3Shader_SetVBoundary function to set the current boundary-handling mode for v values that are outside the range 0 to 1.

TQ3Status Q3Shader_SetVBoundary (
                     TQ3ShaderObject shader,
                     TQ3ShaderUVBoundary vBoundary);
shader
A shader.
vBoundary
A value that indicates the desired method of handling v values that are outside the range 0 to 1. See "Boundary-Handling Methods" for a description of the values that you can pass in this parameter.

DESCRIPTION

The Q3Shader_SetVBoundary function sets the boundary-handling method for v values to be used by the shader specified by the shader parameter to the method specified by the vBoundary parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |